/**
 * @Author: huangcc
 * @Date: 2022-04-11
 * @Last Modified by: huangcc
 * @Last Modified time: 2022-04-11
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 查询当前登录人
export const getLoginInfo = () => axios.get(`${SERVER.WHOLESALES}/baseData/getLoginInfo`)

// 列表查询
export const getList = (params) => axios.post(`${SERVER.WHOLESALES}/orderManage/queryList`, params)
//  导出
export const exportList = (params) => axios.post(`${SERVER.WHOLESALES}/orderManage/export`, params, { responseType: 'blob' })
// 导出
export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);
// 删除
export const deleteOrderById = (params) => axios.get(`${SERVER.WHOLESALES}/orderManage/deleteOrderById`, { params })

// 本月截止提报时间 /tmBusinessPara/getDeadlineTime
export const getDeadlineTime = params => axios.post(`${SERVER.WHOLESALES}/ttVsDemandPlan1SideC/getDeadlineTime`, params);

//获取订单细分类型
export const getOrderDetailType = (params) => axios.get(`${SERVER.WHOLESALES}/baseData/getFiOrderTypeSub`, { params })
// 获取经销商收车地址
export const getDealerAddress = (params) => axios.get(`${SERVER.WHOLESALES}/baseData/getDealerAddress`, { params })
// 获取自提地址
export const getSelfAddress = () => axios.get(`${SERVER.WHOLESALES}/baseData/getSelfAddress`)
//获取经销商余额池
export const getAmount = (params) => axios.get(`${SERVER.WHOLESALES}/baseData/getAmount`, { params })
// 查询经销商资金账户
export const getFiAccountType = (params) => axios.get(`${SERVER.WHOLESALES}/baseData/getFiAccountType`, { params })
// 查询增补订单提报订单明细资金
export const getOrderDetailAmount = (params) => axios.post(`${SERVER.WHOLESALES}/baseData/getOrderDetailAmount`, params)

// 保存订货单
export const saveOrder = (params) => axios.post(`${SERVER.WHOLESALES}/orderManage/saveOrder`, params)

// 查询详情
export const getDetail = (params) => axios.get(`${SERVER.WHOLESALES}/orderManage/getOrderById`, { params })
// 获取车辆列表
export const getCarList = (params) => axios.post(`${SERVER.BASEDATA}/productGroup/queryList`, params)

// 查询所有员工
export const getDealerUser = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getDealerUser`);
// 查询操作记录
export const getLog = (params) => axios.get(`${SERVER.WHOLESALES}/orderManage/queryOrderLog`, {params})
// 查询操作记录
export const deliveryOrderLog = (params) => axios.get(`${SERVER.WHOLESALES}/ttVsDeliveryOrderLog/list`, {params})

// 车辆配置五级选择
export const vehicleConfiguration = (id, params) => axios.get(`${SERVER.BASEDATA}/vehicleProduct/productInfo/productTreeNew`, { params: { type: id, level: 6, ...params } });

/* 选车页面 五个请求 ============================================================*/
export const queryCarListSideC = (params) => axios.post(`${SERVER.WHOLESALES}/baseData/queryCarListSideC`, params);
export const getProductBrandTree = params => axios.get(`${SERVER.WHOLESALES}/baseData/getProductBrandTree`, { params });
//内饰外饰
export const listColor = params => axios.get(`${SERVER.WHOLESALES}/baseData/listColor`, { params });
//配置
export const queryAllOption = params => axios.get(`${SERVER.WHOLESALES}/baseData/queryAllOption`, { params });
//选配
export const queryAllPackage = params => axios.get(`${SERVER.WHOLESALES}/baseData/queryAllPackage`, { params });
/* 选车页面 五个请求 ============================================================*/

// 获取折扣详情
export const getAllDiscount = (params) => axios.post(`${SERVER.WHOLESALES}/orderGoods/getAllDiscount`, params)
// 获取订单细分类型
export const getNotPage = (params) => axios.get(`${SERVER.WHOLESALES}/fiOrderTypeSub/searchFiOrderTypeSubDTOListNotPage`, { params })



